package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(name = "service-cart")
public interface CartFeignClient {

    //添加商品到购物车
    @PostMapping("/api/cart/addToCart/{skuId}/{skuNum}")
    public Result addToCart(@PathVariable Long skuId,
                            @PathVariable Integer skuNum);

    //查询购物车商品
    @GetMapping("/api/cart/getCartInfo/{skuId}")
    public Result getCartInfo(@PathVariable Long skuId);

    //查询选中的购物车集合
    @GetMapping("/api/cart/cartListIsChecked")
    public List<CartInfo> cartListIsChecked();
}
